﻿using System.Collections;
using System.Collections.Generic;
using QxFramework.Core;
using QxFramework.Utilities;
using UnityEngine;

public class Data : Singleton<Data>, ISystemModule
{
    public override void Initialize()
    {
        base.Initialize();
        LoadTable();
    }

    private const string CSVPATH = "CSV"; 

    /// <summary>
    /// 添加CSV表.
    /// </summary>
    public void LoadTable()
    {
        List<string> tableList = new List<string>();
        var tables = Resources.LoadAll(CSVPATH);
        if(tables != null)
        {
            foreach(var table in tables)
            {
                TextAsset textAsset = table as TextAsset;
                if(textAsset != null)
                {
                    tableList.Add(textAsset.text);
                }
            }
        }
        Debug.Log(tableList.Count);
        TableAgent.Instance.Add(tableList);
    }

    public void Update(float deltaTime)
    {

    }

    public void FixedUpdate(float deltaTime)
    {

    }

    public void Dispose()
    {

    }
}
